package GUI;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.KeyboardFocusManager;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter;

import CommonGui.Translate;
import DataObjects.MetaDataOrder;
import Messages.MessageCheckExistsEmpForClockInOut;
import Messages.MessageCheckExistsEmpForClockInOutReply;

public class VKBLettersAndDigits extends JPanel  {
	
	
	private JPanel panel1;
	private JPanel panel2;
	private JPanel panel3;
	private JPanel panel4;
	private JPanel panel5;
	private JPanel panel6;
	private Color color;
	public Translate T;
	private Dimension screenSize;
	private int x;
	private int y;

		 public VKBLettersAndDigits()
		 {
			super();
			screenSize = Toolkit.getDefaultToolkit().getScreenSize();
			x=screenSize.width;
			y=screenSize.height;
			setBackground(new Color(210, 180, 140));		
			T=new Translate();
			this.setLayout(new GridLayout(5, 1,0,0));
			initialize();
		 }
		 
		 public VKBLettersAndDigits(Color c)
		 {
			super();
			screenSize = Toolkit.getDefaultToolkit().getScreenSize();
			x=screenSize.width;
			y=screenSize.height;
			setBackground(new Color(210, 180, 140));		
			T=new Translate(c);
			this.setLayout(new GridLayout(5, 1,0,0));
			initialize();
		 }
		 


			private void initialize()
			{
				
			T.st=new String("");
			T.TextField=new JTextField();
			T.key=new JButton[100];
			T.TextField.setPreferredSize(new Dimension(300,60));
			T.CAPS=1;
			T.init();
			
			panel1=new JPanel();
			panel1.setBackground(new Color(210, 180, 140));
			panel1.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
			for(int i=0;i<13;i++)
				
			{	
				T.key[i].setPreferredSize(new Dimension(x/35,y/25));
				T.key[i].setFont(new Font("Tahoma", Font.BOLD, x/120));
				panel1.add(T.key[i]);
				
			}
			
			T.key[13].setPreferredSize(new Dimension(x/18,y/25));
			T.key[13].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel1.add(T.key[13]);
			this.add(panel1);
			
			
			
			
			
			
			
		
			panel2=new JPanel();
			panel2.setBackground(new Color(210, 180, 140));
			panel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
		    for(int i=0;i<12;i++)			
			{	
				T.key[i+14].setPreferredSize(new Dimension(x/35,y/25));
				T.key[i+14].setFont(new Font("Tahoma", Font.BOLD, x/120));
				panel2.add(T.key[i+14]);			
			}
	    	this.add(panel2);
		
		
		
		
		
		
		
		
		
		panel3=new JPanel();
		panel3.setBackground(new Color(210, 180, 140));
		panel3.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
		for(int i=0;i<12;i++)		
		{	
			T.key[i+14+12].setPreferredSize(new Dimension(x/35,y/25));
			T.key[i+14+12].setFont(new Font("Tahoma", Font.BOLD,x/120));
			panel3.add(T.key[i+14+12]);		
		}
		this.add(panel3);
		
		
		
		
		
		
		
		panel4=new JPanel();
		panel4.setBackground(new Color(210, 180, 140));
		panel4.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
	    for(int i=0;i<10;i++)		
		{	
			T.key[i+14+12+12].setPreferredSize(new Dimension(x/35,y/25));
			T.key[i+14+12+12].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel4.add(T.key[i+14+12+12]);		
		}

	    this.add(panel4);



	    
	    
	    

		panel5=new JPanel();
		panel5.setBackground(new Color(210, 180, 140));
		panel5.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));	
		for(int i=0;i<3;i++)		
		{	
			T.key[i+14+12+12+10].setPreferredSize(new Dimension(x/18,y/25));
			T.key[i+14+12+12+10].setFont(new Font("Tahoma", Font.BOLD,x/120));
			panel5.add(T.key[i+14+12+12+10]);	
		}	
		this.add(panel5);


		
		
		
			
			panel6=new JPanel();
			panel6.setBackground(new Color(210, 180, 140));
			panel6.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
			T.TextField.setSize(300,60);	
			panel6.add(T.TextField);	 
			
			
			
		      setVisible(true);
		      if (T.TextField!=null)
		       T.listen();
		}

			



	}
